#ifndef EDITORCORE_PROPERTYCHANGEACTION_H
#define EDITORCORE_PROPERTYCHANGEACTION_H

#include "EditorCore/Actions/Action.h"
#include "EditorCore/IEntity.h"
#include "EditorCore/Property/Property.h"

namespace editor_core {

	class PropertyChangeAction : public Action
	{
	public:
		PropertyChangeAction( IEntity* entity, const Property& changedProperty );
		virtual ~PropertyChangeAction();

		virtual inline ActionType GetType() const { return ActionType::Undoable; }

	protected:
		virtual bool Commit();
		virtual void Recommit();
		virtual void Rollback();

	private:
		IEntity* m_entity;
		Property m_changedProperty;
		PropertyValue m_newValue;
		PropertyValue m_oldValue;
	};
}

#endif
